#pragma once

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
#include <fstream>

#include "function.h"
#include "Node.h"


class Solver
{
protected:
	Node *node=NULL;
	std::streambuf *cinbuf;
	int countNode;
	int countChildren;
	int colNum=0;
	int rowNum = 0;
	int maxDepth = 0;

public:
	Solver(Node *root=NULL);
	bool checkWinState();
	void createRootStandard();
	bool compare(Node *node1, Node *node2);
	std::string findPath(Node *node);
	void virtual solve(std::string order, std::string id_heuristic="") = 0;
	void virtual firstPush() = 0;
	void virtual getNode()=0;
	bool virtual checkVisited()=0;
	void virtual createChildren(std::string *order) = 0;
	void virtual pushChildren() = 0;
	int getCountNode();
	int getCountChildren();
	int getMaxDepth();
	Node* getActualNode();
	void randomOrder(std::string *order);

	~Solver();
};

